using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ServerTools._Caching
{
    /// <summary>
    /// <para>Import Map Server Cache</para>
    /// <para>Imports tiles from a folder on disk into a map image layer cache.</para>
    /// <para>将切片从磁盘上的文件夹导入到地图图像图层缓存中。</para>
    /// </summary>    
    [DisplayName("Import Map Server Cache")]
    public class ImportMapServerCache : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ImportMapServerCache()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_service">
        /// <para>Input Service</para>
        /// <para>The map image layer with the cache tiles to be imported. You can choose it by browsing to the desired service in a portal, or you can drag a web tile layer from the Portal tab in the Project pane to supply this parameter.</para>
        /// <para>包含要导入的缓存切片的地图图像图层。您可以通过浏览至门户中的所需服务来选择它，也可以从工程窗格的门户选项卡拖动 Web 切片图层以提供此参数。</para>
        /// </param>
        /// <param name="_source_cache_type">
        /// <para>Source Cache Type</para>
        /// <para><xdoc>
        ///   <para>Imports a cache from a cache dataset or tile package to a cached map or image service running on the server.</para>
        ///   <bulletList>
        ///     <bullet_item>Map or image service cache—A map or image service cache that is generated using ArcGIS Server. It can be used in ArcGIS Desktop and by ArcGIS Server map or image services.</bullet_item><para/>
        ///     <bullet_item>Tile package—A single compressed file where the cache dataset is added as a layer and consolidated so that it can be shared. It can be used in ArcGIS Desktop, ArcGIS Runtime, and mobile apps.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓存从缓存数据集或切片包导入到服务器上运行的缓存地图或影像服务。</para>
        ///   <bulletList>
        ///     <bullet_item>地图或影像服务缓存 - 使用 ArcGIS Server 生成的地图或影像服务缓存。它可以在 ArcGIS Desktop 以及 ArcGIS Server 地图或影像服务中使用。</bullet_item><para/>
        ///     <bullet_item>切片包 - 单个压缩文件，其中缓存数据集将添加为图层并合并，以便可以共享。它可以在 ArcGIS Desktop、ArcGIS Runtime 和移动应用程序中使用。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public ImportMapServerCache(object _input_service, _source_cache_type_value _source_cache_type)
        {
            this._input_service = _input_service;
            this._source_cache_type = _source_cache_type;
        }
        public override string ToolboxName => "Server Tools";

        public override string ToolName => "Import Map Server Cache";

        public override string CallName => "server.ImportMapServerCache";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_input_service, _source_cache_type.GetGPValue(), _source_cache_dataset, _source_tile_package, _upload_data_to_server.GetGPValue(), _scales, _num_of_caching_service_instances, _area_of_interest, _import_extent, _overwrite.GetGPValue(), _out_job_url];

        /// <summary>
        /// <para>Input Service</para>
        /// <para>The map image layer with the cache tiles to be imported. You can choose it by browsing to the desired service in a portal, or you can drag a web tile layer from the Portal tab in the Project pane to supply this parameter.</para>
        /// <para>包含要导入的缓存切片的地图图像图层。您可以通过浏览至门户中的所需服务来选择它，也可以从工程窗格的门户选项卡拖动 Web 切片图层以提供此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Service")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_service { get; set; }


        /// <summary>
        /// <para>Source Cache Type</para>
        /// <para><xdoc>
        ///   <para>Imports a cache from a cache dataset or tile package to a cached map or image service running on the server.</para>
        ///   <bulletList>
        ///     <bullet_item>Map or image service cache—A map or image service cache that is generated using ArcGIS Server. It can be used in ArcGIS Desktop and by ArcGIS Server map or image services.</bullet_item><para/>
        ///     <bullet_item>Tile package—A single compressed file where the cache dataset is added as a layer and consolidated so that it can be shared. It can be used in ArcGIS Desktop, ArcGIS Runtime, and mobile apps.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓存从缓存数据集或切片包导入到服务器上运行的缓存地图或影像服务。</para>
        ///   <bulletList>
        ///     <bullet_item>地图或影像服务缓存 - 使用 ArcGIS Server 生成的地图或影像服务缓存。它可以在 ArcGIS Desktop 以及 ArcGIS Server 地图或影像服务中使用。</bullet_item><para/>
        ///     <bullet_item>切片包 - 单个压缩文件，其中缓存数据集将添加为图层并合并，以便可以共享。它可以在 ArcGIS Desktop、ArcGIS Runtime 和移动应用程序中使用。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Source Cache Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _source_cache_type_value _source_cache_type { get; set; }

        public enum _source_cache_type_value
        {
            /// <summary>
            /// <para>Map or image service cache</para>
            /// <para>Map or image service cache—A map or image service cache that is generated using ArcGIS Server. It can be used in ArcGIS Desktop and by ArcGIS Server map or image services.</para>
            /// <para>地图或影像服务缓存 - 使用 ArcGIS Server 生成的地图或影像服务缓存。它可以在 ArcGIS Desktop 以及 ArcGIS Server 地图或影像服务中使用。</para>
            /// </summary>
            [Description("Map or image service cache")]
            [GPEnumValue("CACHE_DATASET")]
            _CACHE_DATASET,

            /// <summary>
            /// <para>Tile package</para>
            /// <para>Tile package—A single compressed file where the cache dataset is added as a layer and consolidated so that it can be shared. It can be used in ArcGIS Desktop, ArcGIS Runtime, and mobile apps.</para>
            /// <para>切片包 - 单个压缩文件，其中缓存数据集将添加为图层并合并，以便可以共享。它可以在 ArcGIS Desktop、ArcGIS Runtime 和移动应用程序中使用。</para>
            /// </summary>
            [Description("Tile package")]
            [GPEnumValue("TILE_PACKAGE")]
            _TILE_PACKAGE,

        }

        /// <summary>
        /// <para>Source Cache Dataset</para>
        /// <para>The path to the tiles that will be imported. This is represented by a raster dataset icon when you are browsing. You do not have to specify a registered server cache directory; most of the time you'll specify a location on disk where tiles have been previously exported. This location should be accessible to the ArcGIS Server account. If the ArcGIS Server account cannot be granted access to this location, check the Upload data to server parameter.</para>
        /// <para>将导入的切片的路径。当您浏览时，这由栅格数据集图标表示。您不必指定已注册的服务器缓存目录;大多数情况下，您需要在磁盘上指定之前导出切片的位置。ArcGIS Server 帐户应可访问此位置。如果无法授予 ArcGIS Server 帐户访问此位置的权限，请选中将数据上传到服务器参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Source Cache Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_cache_dataset { get; set; } = null;


        /// <summary>
        /// <para>Source Tile Package</para>
        /// <para>The path to the tile package that will be imported. This location should be accessible to the ArcGIS Server account. Importing a tile package file to a cached map or image service automatically enables the Upload data to server parameter.</para>
        /// <para>将导入的切片包的路径。ArcGIS Server 帐户应可访问此位置。将切片包文件导入缓存地图或影像服务时，会自动启用将数据上传到服务器参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Source Tile Package")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_tile_package { get; set; } = null;


        /// <summary>
        /// <para>Upload data to server</para>
        /// <para><xdoc>
        ///   <para>Check this parameter if the ArcGIS Server account does not have read access to the source cache. The tool will upload the source cache to the ArcGIS Server uploads directory before moving it to the ArcGIS Server cache directory.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Tiles are placed in the server uploads directory and are then moved to the server cache directory. This is active by default when the Source Cache Type parameter is set to TILE_PACKAGE.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Tiles are imported directly into the server cache directory. The ArcGIS Server account must have read access to the source cache.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果 ArcGIS Server 帐户不具有对源缓存的读取权限，请选中此参数。该工具会先将源缓存上传到 ArcGIS Server 上传目录，然后再将其移动到 ArcGIS Server 缓存目录。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 切片放置在服务器上传目录中，然后移动到服务器缓存目录。默认情况下，当“源缓存类型”参数设置为“TILE_PACKAGE”时，此选项处于活动状态。</bullet_item><para/>
        ///     <bullet_item>未选中 - 切片将直接导入到服务器缓存目录中。ArcGIS Server 帐户必须具有对源缓存的读取权限。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Upload data to server")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _upload_data_to_server_value _upload_data_to_server { get; set; } = _upload_data_to_server_value._false;

        public enum _upload_data_to_server_value
        {
            /// <summary>
            /// <para>UPLOAD_DATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("UPLOAD_DATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_UPLOAD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_UPLOAD")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Scales</para>
        /// <para><xdoc>
        ///   <para>A list of scale levels at which tiles will be imported.</para>
        ///   <para>By default, the scales listed in the tool dialog box are between the minimum and maximum cached scales for the service. To update the scale range, go to the Service EditorCaching tab and use the sliders to update the minimum and maximum cached scales.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将导入切片的比例级别列表。</para>
        ///   <para>默认情况下，工具对话框中列出的比例介于服务的最小和最大缓存比例之间。要更新缩放范围，请转到“服务编辑器缓存”选项卡，然后使用滑块更新最小和最大缓存缩放。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Scales")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _scales { get; set; } = null;


        /// <summary>
        /// <para>Number of caching service instances</para>
        /// <para>Specifies the number of instances that will be used to update or generate the tiles. The value for this parameter is set to unlimited (-1) and cannot be modified.</para>
        /// <para>指定将用于更新或生成切片的实例数。此参数的值设置为无限制 （-1），无法修改。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of caching service instances")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _num_of_caching_service_instances { get; set; } = null;


        /// <summary>
        /// <para>Area Of Interest</para>
        /// <para><xdoc>
        ///   <para>An area of interest polygon that spatially constrains where tiles are imported into the cache. This parameter is useful if you want to import tiles for irregularly shaped areas, as the tool clips the cache dataset, which intersects the polygon at pixel resolution and imports it to the service cache directory.</para>
        ///   <para>If you do not provide a value for this parameter, the value of the Import Extent parameter will be used. The default is to use the full extent of the map.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>感兴趣区域面，用于在空间上限制切片导入缓存的位置。如果要导入形状不规则的区域的切片，则此参数非常有用，因为该工具会裁剪缓存数据集，该数据集以像素分辨率与面相交，并将其导入到服务缓存目录。</para>
        ///   <para>如果未为此参数提供值，则将使用导入范围参数的值。默认设置是使用地图的全图范围。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Area Of Interest")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _area_of_interest { get; set; } = null;


        /// <summary>
        /// <para>Import Extent</para>
        /// <para><xdoc>
        ///   <para>A rectangular extent defining the tiles to be imported into the cache. By default, the extent is set to the full extent of the map service into which you are importing. Note that the optional parameter on this tool, Area Of Interest, allows you to spatially constrain the imported tiles using an irregular shape. If values are provided for both parameters, the Area Of Interest parameter takes precedence over Import Extent.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the data frame or visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义要导入缓存的切片的矩形范围。默认情况下，范围设置为要导入到的地图服务的全图范围。请注意，此工具的可选参数“感兴趣区域”允许您使用不规则形状在空间上约束导入的切片。如果为这两个参数都提供了值，则感兴趣区域参数优先于导入范围。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于数据框或可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Import Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _import_extent { get; set; } = null;


        /// <summary>
        /// <para>Overwrite Tiles</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the images in the destination cache will be merged with the tiles from the originating cache or overwritten by them.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The import replaces all pixels in the area of interest, effectively overwriting tiles in the destination cache with tiles from the originating cache.</bullet_item><para/>
        ///     <bullet_item>Unchecked—When the tiles are imported, transparent pixels in the originating cache are ignored by default. This results in a merged or blended image in the destination cache. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定目标缓存中的图像是与原始缓存中的切片合并还是被它们覆盖。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 导入将替换感兴趣区域中的所有像素，从而有效地将目标缓存中的切片覆盖为原始缓存中的切片。</bullet_item><para/>
        ///     <bullet_item>未选中 - 导入切片时，默认情况下将忽略原始缓存中的透明像素。这会导致目标缓存中出现合并或混合的图像。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Overwrite Tiles")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _overwrite_value _overwrite { get; set; } = _overwrite_value._false;

        public enum _overwrite_value
        {
            /// <summary>
            /// <para>OVERWRITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("OVERWRITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>MERGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MERGE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Map Service URL</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Map Service URL")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_job_url { get; set; }


        public ImportMapServerCache SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}